Skip to content

Redesigned configuration handling#264

Open
Snapex2409 wants to merge 6 commits into
developfrom
new-config-design
Open

Redesigned configuration handling#264
Snapex2409 wants to merge 6 commits into
developfrom
new-config-design

Conversation

@Snapex2409
Copy link
Copy Markdown
Collaborator

@Snapex2409 Snapex2409 commented May 15, 2026

This implementation should simplify future changes to configuration entries.
Error handling was shifted towards special loading contexts.

The core concepts are:

  • There is no need for a long list of backing fields anymore. New config entry "getters" just need to be marked with @config_entry
  • Loading entries from file uses the ConfigDSL, which provides the methods get_or_none, get_with_default and get_or_raise. These methods can accept default args and format strings for success or failure.
  • The internal config entry naming scheme was slightly altered: Since "getters" are now enriched with further attributes, the "get" prefix was dropped. Entries representing bool flags now begin with "enable" instead of "turn_on"

Checklist:

  • I made sure that the CI passed before I ask for a review.
  • I added a summary of the changes (compared to the last release) in the CHANGELOG.md.
  • If necessary, I made changes to the documentation and/or added new content.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

@Snapex2409 Snapex2409 requested a review from IshaanDesai May 15, 2026 16:31
@IshaanDesai IshaanDesai marked this pull request as ready for review May 18, 2026 07:35
Copy link
Copy Markdown
Member

@IshaanDesai IshaanDesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change to the configuration module makes a lot of sense. I just have a few questions before merging this.

Comment thread micro_manager/config.py
Comment thread micro_manager/config.py
Comment thread micro_manager/config.py Outdated
Comment thread micro_manager/config.py
@IshaanDesai IshaanDesai added the enhancement Enchance existing functionality label May 20, 2026
@Snapex2409 Snapex2409 force-pushed the new-config-design branch from 2ad4cff to 373e665 Compare May 20, 2026 09:16
Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
@IshaanDesai
Copy link
Copy Markdown
Member

Ready to squash and merge. Please add a changelog, as this is a significant change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enchance existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add defaults or require mandatory inputs for configuration parameters

2 participants